package com.leigq.www.mybatisplusstudy.domain.entity.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.*;
import lombok.experimental.FieldNameConstants;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;


/**
 * 修改使用的基类
 *
 * @author leiguoqing
 */
@EqualsAndHashCode(callSuper = true)
@Data
@FieldNameConstants(level = AccessLevel.PROTECTED, innerTypeName = "F")
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class UpdateWithVersionEntity extends UpdateEntity implements Serializable {

    private static final long serialVersionUID = 7295728505178702262L;


    /**
     * 版本，乐观锁
     */
    @TableField(value = "version", fill = FieldFill.INSERT)
    @Version
    private Integer version;
}
